#pragma once
#include<stdio.h>

#define SIZE 1024
#define FLUSH_NONE (1<<0)
#define FLUSH_LINE (1<<1)
#define FLUSH_FULL (1<<2)

typedef struct IO_FILE
{
    int flag;  //刷新方式
    int fileno;
    char outbuffer[SIZE];
    int bufferlen; //已使用字节数
    int  flush_method;
}My_FILE;

My_FILE* myfopen(const char* filename,const char* mode);

int myfwrite(const void *ptr,int num, My_FILE* stream);

void myfflush(My_FILE* stream);

void myfclose(My_FILE* stream);
